package com.study.services;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.study.model.jdao.ISupplierDAO;
import com.study.model.mdao.SupplierMapper;
import com.study.model.pojo.Supplier;

@Service
@Transactional(rollbackOn = Exception.class)
public class SupplierService {
	@Autowired
	private ISupplierDAO dao;
	@Autowired
	private SupplierMapper spMapper;
	
	public Supplier queryByid(int supno) {
		return dao.findBySupno(supno);
	}
	
	
	/**
	 * 查询所有供应商
	 * @param supplier
	 * @return
	 */
	public List<JSONObject> findAll(Supplier supplier){
		return spMapper.findAll(supplier);
	}
}
